package com.briup.day18;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author lining
 * @date 2024/1/30 9:32
 */
public class TestFileWriter {
    public static void main(String[] args) throws Exception {
        FileWriter fw = new FileWriter("a.txt");
        fw.write("a");
        fw.write("b");
        fw.flush();
        fw.close();
        //继续操作流对象进行写操作,运行错误 提示流已经关闭
        fw.write("c");
        //java.io.IOException: Stream closed
    }
}
